<%-- Created by IntelliJ IDEA. --%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="java.sql.*" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="java.util.List" %>
<%@taglib prefix="mytaglib" uri="http://www.zz.com/mytaglib" %>
<!doctype html>
<html lang="en">
<head>
    <title></title>
    <link rel="stylesheet" href="css/myStyle.css">
</head>
<body>
<div>
    <mytaglib:Query driver="com.mysql.jdbc.Driver"
                    url="jdbc:mysql://localhost:3306/spark?useSSL=true"
                    user="root" pass="1111" sql="select * from student"/>
    <p>自定义标签显示: <mytaglib:HelloWorld/></p>
    <p>带属性的自定义标签</p>
    <mytaglib:Query driver="com.mysql.jdbc.Driver"
    url="jdbc:mysql://localhost:3306/spark?useSSL=true"
    user="root" pass="1111" sql="select * from user"/>
    <p>带标签体的自定义标签</p>
<%
    List<String> lst = new ArrayList<>();
    lst.add("Java");
    lst.add("Scala");
    lst.add("Python");
    pageContext.setAttribute("lst",lst);
%>
    <table class="stable">
        <mytaglib:Iterator collection="lst" item="item">
            <tr><td>${pageScope.get("item")}</td></tr>
        </mytaglib:Iterator>
    </table>
    <p>带fragment属性的自定义标签</p>
    <mytaglib:Fragment>
        <jsp:attribute name="fragment">
            <mytaglib:HelloWorld/>
        </jsp:attribute>
    </mytaglib:Fragment>
    <mytaglib:Fragment>
        <jsp:attribute name="fragment">
        ${pageContext.request.remoteAddr}
        </jsp:attribute>
    </mytaglib:Fragment>
    <p>动态属性标签</p>
    <mytaglib:DynaAttr name="crazyit" url="crazyit.org"/><br>
    <mytaglib:DynaAttr 书名="疯狂java" 价格="99.0" 出版时间="2008年" 描述="Java图书"/><br>
</div>
</body>
</html>